<h1 class="page-header">
    <small>后台管理员管理</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-5">
    <div class="panel-heading">
        <h4 class="panel-title">管理员查询</h4>
    </div>
    <div class="panel-body">
        <form id="accountForm" name="accountForm" method="post" class="form-inline">
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_accountName" value="${LIKE_accountName}"
                       placeholder="用户名">
            </div>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="EQ_accountKey" value="${EQ_accountKey}"
                       placeholder="编号">
            </div>
            <#if tAccount?exists &&tAccount?size gt 0>
            <input type="hidden" class="form-control" name="EQ_storeID" value="${EQ_storeID}"
                   placeholder="店铺ID">
            </#if>
            <button type="button" class="btn btn-sm btn-success m-r-5"
                    onclick="postDataByForm('user/query','displayArea','accountForm')"><i class="fa fa-search"></i>查 询
            </button>
            <button type="button" class="btn btn-sm btn-danger m-r-5"
                    onclick="getData('${rc.contextPath}/user/add','displayArea')"><i class="fa fa-plus"></i>新增
            </button>
        </form>
    </div>
</div>
<hr/>
<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <h4 class="panel-title">账户列表</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>账户编号</th>
                <th>账户名称</th>
                <th>管辖店铺</th>
                <th>是否有效</th>
                <th>激活状态</th>
                <th>真实姓名</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#if paginationResponse?has_content && paginationResponse.content?exists>
                <#list paginationResponse.content as ct>
                    <tr>
                        <td>${ct.accountKey}</td>
                        <td>${ct.accountName}</td>
                        <td><#if ct.storeId == -1> 全部店铺 <#else>${ct.storeName}</#if></td>

                        <td>
                            <#if ct.accountStatus == 0>
                            <span class="status-disabled">无效</span>
                            <#else>
                            <span class="status-active">有效</span>
                            </#if>
                        </td>
                        <td>
                            <#if ct.isActive == 0>
                            <span class="status-disabled">未激活</span>
                            <#else>
                            <span class="status-active">已激活</span>
                            </#if>
                        </td>
                        <td>${ct.realName}</td>
                        <td>${ct.createDate}</td>
                        <td>
                            <#if ct.accountStatus == 1>
                            <a class="label label-danger small-btn" href="javascript:getConfirmData('确定禁用该账户吗?','${rc.contextPath}/user/delete/${ct.accountKey}','displayArea')"><i class="fa fa-lock"></i>禁用</a>
                            <#else>
                            </#if>
                            <a class="label label-success small-btn" href="javascript:getData('${rc.contextPath}/user/edit/${ct.accountKey}','displayArea')"><i class="fa fa-edit"></i>编辑</a>
                        </td>
                    </tr>
                </#list>
            </#if>
        </table>
    </div>
</div>

<!-- 分页组件 -->
<!-- recordBean 分页查询结果Bean
     action 分页请求URL
     formName 分页需要的查询参数的表单名称 -->
<@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/user/query" formName="accountForm"/>